package cn.dnuifood_cjy.dnuifood_16110100529.controller;


public class SomeClass {
    private String privateField;
    protected String protectedField;
    public String publicField;
    //无参数构造器（Constructor）
    public SomeClass(){

    }
    //有参数构造器（Constructor）
    public SomeClass(String privateField, String protectedField, String publicField){

        this.privateField = privateField; this.protectedField = protectedField; this.publicField = publicField;
    }
    //getter 和  setter 方法（Method）
    public String getPrivateField() { return privateField;
    }
    public void setPrivateField(String privateField) { this.privateField = privateField;
    }
    public String getProtectedField() { return protectedField;
    }
    public void setProtectedField(String protectedField) { this.protectedField = protectedField;
    }
    public String getPublicField() { return publicField;
    }
    public void setPublicField(String publicField) { this.publicField = publicField;
    }
    //私有的成员方法（Method）
    private void privateMethod(String value){ privateField = value;
        System.err.println("private field " + privateField);
    }
    //保护的成员方法（Method）
    protected void protectedMethod(String value){ protectedField = value; System.err.println("protected field " + value);
    }
    //共有的成员方法（Method）
    public void publicMethod(String value){ publicField = value; System.err.println("public field " + value);
    }
}


